{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-slideshow.tpl"}</nav>
    <article class="right-col">
    	<h2>Album ảnh {$arrSmarty.slideshows[$smarty.get.type]}{if isset($smarty.session.slideshow) && (($smarty.session.slideshow&1<<1) > 0)} &raquo; <a href="{$smarty.const.HOST_BACKEND}slideshow/upload?type={$smarty.get.type}">Thêm mới</a>{/if}</h2>
        {include file="slideshow/album-stt.tpl"}
        <form name="frmSlideshow" id="frmSlideshow" action="{$smarty.const.HOST_BACKEND}slideshow/act" method="post" enctype="multipart/form-data">
            <input type="hidden" name="paction" id="paction"/>
            <input type="hidden" name="pbackurl" id="pbackurl" value="{$smarty.const.HOST_BACKEND}slideshow/index"/>
            {if $arrResult}
            	{if isset($smarty.session.slideshow)}     
                	<div class="s-button">
                        {if ($smarty.session.slideshow&1<<4) > 0}
                        	<button type="button" onclick="javascript:confirmPending(this.form);">Tạm dừng</button>
                        {/if}  
                        {if ($smarty.session.slideshow&1<<5) > 0}
                        	<button type="button" onclick="javascript:confirmActive(this.form);">Kích hoạt / Phục hồi</button>
                        {/if}                                                                                   
                        {if ($smarty.session.slideshow&1<<3) > 0} 	
                        	<button type="button" onclick="javascript:confirmDelete(this.form);">Xóa</button> 
                        {/if}
	                </div>
            	{/if}
                {if $intTotal > 0}
                    <div class="s-page">
                    	<strong class="total">Tổng số: {$intTotal} album</strong>
                        {paging total=$intTotal limit=$intLimit offset=$intOffset url=$strUrl}
                    </div>
                {/if}
            {/if}
            <table width="100%" cellpadding="0" cellspacing="0" border="0" class="list">
                <thead>
                    <tr>
                        {if $arrResult && isset($smarty.session.slideshow) && ( (($smarty.session.slideshow&1<<3)>0) || (($smarty.session.slideshow&1<<4)>0) )}
                            <th width="30"><input type="checkbox" name="pcheckall" id="pcheckall" onclick="javascript:checkAll(this.form,'palbumid[]',this.checked);"/></th>
                        {/if}      
                        <th width="130">Hình trong album</th>                                 
                        <th>Tiêu đề</th>
                        <th width="100">Tổng hình</th>
                        <th width="80">Tình trạng</th>
                        <th width="80">Ngày đăng</th>
                        {if $arrResult && isset($smarty.session.slideshow)}
                            <th width="50">&nbsp;</th>
                        {/if}
                    </tr>
                </thead>
                <tbody>
                    {if $arrResult}
                        {foreach item=item from=$arrResult}
                            <tr class="{cycle values="odd,even"}">
                                {if isset($smarty.session.slideshow) && ((($smarty.session.slideshow&1<<3)>0) || (($smarty.session.slideshow&1<<4)>0))}
                                    <td align="center">
                                        <input type="checkbox" id="palbumid{$item.albumid}" name="palbumid[]" value="{$item.albumid}" onclick="javascript:checkOneItem(this.form, 'pcheckall')"/>
                                    </td>
                                {/if}
                                <td>
                                	{if $intType == $smarty.const.EDUCATION_TYPE}
                                		{image type="education" path=$item.image size=2 attr="style=\"max-width:130px;\""}
                                    {/if}
                                </td>
                                <td>
                                    {$item.name}                       
                                </td>    
                                <td align="right">{$item.timage}</td>                                            
                                <td align="center">
                                    {if $item.status == 0}
                                        <img src="{$smarty.const.HOST_STATICS}backend/img/ad-unaccept.png" width="16" height="" alt="Tạm dừng" border="0" title="Tạm dừng" />
                                    {elseif $item.status == 1}
                                         <img src="{$smarty.const.HOST_STATICS}backend/img/ad-accept.png" alt="Đang kích hoạt" border="0" width="16" height="16" />
                                    {elseif $item.status == 2}
                                        <img src="{$smarty.const.HOST_STATICS}backend/img/ad-cancel.png" alt="Bị xóa" border="0" width="16" height="16" />
                                    {/if}
                                </td>
                                <td align="center">{$item.postdate|date_format:"%d/%m/%Y"}<br/>{$item.postdate|date_format:"%H:%M:%S"}</td>
                                <td align="center">
                                    {if isset($smarty.session.slideshow)} 
                                        {if ($smarty.session.slideshow&1<<1)>0}
                                            <a href="{$smarty.const.HOST_BACKEND}slideshow/upload?form=1&amp;albumid={$item.albumid}&amp;type={$intType}" title="Upload hình">
                                                <img src="{$smarty.const.HOST_STATICS}backend/img/ad-attach.png" alt="Upload" border="0" width="16" height="16" />
                                            </a>
                                        {/if}                                                   	
                                        {if ($smarty.session.slideshow&1<<2)>0}
                                            <a href="{$smarty.const.HOST_BACKEND}slideshow/upload?form=2&amp;albumid={$item.albumid}&amp;type={$intType}" title="Cập nhật thông tin">
                                                <img src="{$smarty.const.HOST_STATICS}backend/img/ad-edit.png" alt="Edit" border="0" width="16" height="16" />
                                            </a>
                                        {/if}
                                    {else}
                                        &nbsp;
                                    {/if}
                                </td>
                            </tr>
                        {/foreach}
                    {else}
                        <tr><td colspan="7" align="center">Không có dữ liệu</td></tr>
                    {/if}
                </tbody>
            </table>
    		{if $arrResult}
            	{if $intTotal > 0}
                    <div class="s-page">
                    	<strong class="total">Tổng số: {$intTotal} album</strong>
                        {paging total=$intTotal limit=$intLimit offset=$intOffset url=$strUrl}
                    </div>
                {/if}
            	{if isset($smarty.session.slideshow)}     
                	<div class="s-button">
                        {if ($smarty.session.slideshow&1<<4) > 0}
                        	<button type="button" onclick="javascript:confirmPending(this.form);">Tạm dừng</button>
                        {/if}  
                        {if ($smarty.session.slideshow&1<<5) > 0}
                        	<button type="button" onclick="javascript:confirmActive(this.form);">Kích hoạt / Phục hồi</button>
                        {/if}                                                                                   
                        {if ($smarty.session.slideshow&1<<3) > 0} 	
                        	<button type="button" onclick="javascript:confirmDelete(this.form);">Xóa</button> 
                        {/if}
	                </div>
            	{/if}
                
            {/if}
        </form>
    </article>
</section>
{include file="common/footer.tpl"}
                
